home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / doodle_d.swf / scripts / DefineSprite_26_en12 / frame_1 / DoAction.as
Text File  |  2013-04-24  |  1KB  |  51 lines

  1. function onEnterFrame()
  2. {
  3.    _X = _X + dx;
  4.    _Y = _Y + dy;
  5.    if(_Y > 880 || _Y < 0)
  6.    {
  7.       dy *= -1;
  8.       _Y = _Y + dy * 2;
  9.    }
  10.    if(_X < 0 || _X > 640)
  11.    {
  12.       if(_X > 640)
  13.       {
  14.          _X = 640;
  15.       }
  16.       if(_X < 0)
  17.       {
  18.          _X = 0;
  19.       }
  20.       dx *= -1;
  21.       _X = _X + dx * 2;
  22.       _xscale = _xscale * -1;
  23.    }
  24.    if(this.hitTest(_root.ship))
  25.    {
  26.       depth = _root.getNextHighestDepth();
  27.       _root.attachMovie("exp","exp" + depth,depth);
  28.       exp = eval("_root.exp" + depth);
  29.       exp._x = _X;
  30.       exp._y = _Y;
  31.       _root.eAmount--;
  32.       _root.death();
  33.       this.removeMovieClip();
  34.    }
  35.    if(h <= 0)
  36.    {
  37.       _root.eAmount = 0;
  38.       _root.points += 4000;
  39.       _root.eD = _root.eD + 1;
  40.       depth = _root.getNextHighestDepth();
  41.       _root.attachMovie("exp","exp" + depth,depth);
  42.       exp = eval("_root.exp" + depth);
  43.       exp._x = _X;
  44.       exp._y = _Y;
  45.       this.removeMovieClip();
  46.    }
  47. }
  48. dx = Math.random() * 3 + 3;
  49. dy = (Math.random() * 2 + 2) * -1;
  50. h = 200;
  51.